export default function myInstanceOf(obj, target) {
    if (target === null) return false
    if (typeof obj !== 'object' && typeof obj !== 'function') return false
    if (typeof target !== 'function') {
        throw new TypeError('TypeErr: origin is not a function')
    }
    if (typeof target !== 'object') {
        throw new TypeError("MyTypeErr:Right-hand side of 'instanceof' is not an object")
    }
    let proto = Object.getPrototypeOf(obj)
    while (proto) {
        if (proto === target.prototype)  return true
        proto = Object.getPrototypeOf(proto)
    }
    return false
}
